<% include header %>
<div class="container">
    <div class="ui two column centered grid">
        <div class="left floated left aligned four wide column">
            <% if($this.session.user){ %>
            <% var name = $this.session.user.name; %>
            <% include partials/userCard %>
            <% } %>
            <% include partials/noReplyCard %>
            <% include partials/connectCard %>
        </div>
        <div class="right floated twelve wide column" id="settings">
            <% if($this.session.user) {%>
            <% var na = $this.session.user.name %>
            <% var objuser = yield $User.getUserByName(na) %>
            <form method="post" class="ui form">
                <div class="field">
                    <label>用户名</label>
                    <input type="text" name="name" placeholder="" value="<%= na %>">
                </div>
                <div class="field">
                    <label>电子邮件</label>
                    <input type="text" name="email" placeholder="" value="<%= $this.session.user.email %>">
                </div>
                <div class="field">
                    <label>个人网站</label>
                    <input type="text" name="personalweb" value="<%= objuser.personalweb %>" placeholder="">
                </div>
                <div class="field">
                    <label>所在地</label>
                    <input type="text" name="place" value="<%= objuser.place %>" placeholder="">
                </div>
                <div class="field">
                    <label>微博</label>
                    <input type="text" name="weibo" value="<%= objuser.weibo %>" placeholder="">
                </div>
                <div class="field">
                    <label>Github</label>
                    <input type="text" name="github" value="<%= objuser.github %>" placeholder="">
                </div>
                <div class="field">
                    <label>个性签名</label>
                    <input type="text" name="signature" value="<%= objuser.signature %>" placeholder="">
                </div>
                <input type="hidden" value="<%= objuser._id %>" name="_id">
                <input class="ui button" type="submit" value="保存设置">
            </form>
            <form method="post" class="ui form" id="sec_form">
                <div class="field">
                    <label>当前密码</label>
                    <input type="password" placeholder="当前密码" name="password">
                </div>
                <div class="field">
                    <label>新密码</label>
                    <input type="password" placeholder="新密码" name="new_pass">
                </div>
                <input type="hidden" name="name" value="<%= na %>">
                <input class="ui button" type="submit" value="更改密码">
            </form>
            <%}%>
        </div>
    </div>
</div>

<% include footer %>